package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.ISalesPrizesPeopleDao;
import com.financing.platform.dto.SalesPrizesPeopleDTO;
import com.financing.platform.util.SqlName;
/**
 * sales_prizes_people  
 * 销售抽奖人数 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("salesPrizesPeopleDao")
public class SalesPrizesPeopleDaoImpl extends BaseDaoImpl implements ISalesPrizesPeopleDao {


	@Override
	public int insert(SalesPrizesPeopleDTO salesPrizesPeople) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.SalesPrizesPeopleSql.insert, salesPrizesPeople);
	}

	@Override
	public void update(SalesPrizesPeopleDTO salesPrizesPeople) throws SQLException {
		this.sqlMapClient.update(SqlName.SalesPrizesPeopleSql.update, salesPrizesPeople);
	}

	@Override
	public void updateForce(SalesPrizesPeopleDTO salesPrizesPeople) throws SQLException {
		this.sqlMapClient.update(SqlName.SalesPrizesPeopleSql.updateForce, salesPrizesPeople);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.SalesPrizesPeopleSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<SalesPrizesPeopleDTO> queryList(SalesPrizesPeopleDTO salesPrizesPeople) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.SalesPrizesPeopleSql.queryList, salesPrizesPeople);
	}

	@Override
	public int queryListCount(SalesPrizesPeopleDTO salesPrizesPeople) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.SalesPrizesPeopleSql.queryListCount, salesPrizesPeople);
	}

	@Override
	public SalesPrizesPeopleDTO loadById(Integer id) throws SQLException {
		return  (SalesPrizesPeopleDTO)this.sqlMapClient.queryForObject(SqlName.SalesPrizesPeopleSql.loadById,id);
	}
 	
}
